package lastRites.ui;

import lastRites.game.terrain.TerrainBlock;

import org.newdawn.slick.Animation;
import org.newdawn.slick.Image;

public class Item {
	public static Item		LOGS, ROCKS, WOODEN_WALL_01, DIRT;
	private String			name;
	private int				itemId, maxStack;
	private Image			inventoryImage;
	private Animation		worldImage;
	private boolean			placeable;
	private TerrainBlock	worldBlock;

	public Item(String name, Image invImg, Animation anim, int itemId, int maxStack, boolean placeable) {
		this.name = name;
		this.inventoryImage = invImg;
		this.worldImage = anim;
		this.itemId = itemId;
		this.maxStack = maxStack;
		this.placeable = placeable;
	}

	public String getName() {
		return name;
	}

	public Item setName(String name) {
		this.name = name;
		return this;
	}

	public int getItemId() {
		return itemId;
	}

	public Item setItemId(int itemId) {
		this.itemId = itemId;
		return this;
	}

	public Image getInventoryImage() {
		return inventoryImage;
	}

	public Item setInventoryImage(Image inventoryImage) {
		this.inventoryImage = inventoryImage;
		return this;
	}

	public Animation getWorldImage() {
		return worldImage;
	}

	public Item setWorldImage(Animation worldImage) {
		this.worldImage = worldImage;
		return this;
	}

	public int getMaxStack() {
		return maxStack;
	}

	public Item setMaxStack(int maxStack) {
		this.maxStack = maxStack;
		return this;
	}

	public boolean isPlaceable() {
		return placeable;
	}

	public Item setPlaceable(boolean placeable) {
		this.placeable = placeable;
		return this;
	}

	public TerrainBlock getWorldBlock() {
		return worldBlock;
	}

	public Item setWorldBlock(TerrainBlock worldBlock) {
		this.worldBlock = worldBlock;
		return this;
	}

	public Item clone() {
		Item clone = new Item( this.name, this.inventoryImage.copy(), this.worldImage.copy(), this.itemId, this.maxStack, this.placeable ).setWorldBlock( worldBlock );
		return clone;
	}

	public boolean equals(Item item) {
		return this.name.equalsIgnoreCase( item.name );
	}
}
